<?php

namespace BaseBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Orders
 *
 * @ORM\Table(name="orders", options={"comment":"订单表"})
 * @ORM\Entity()
 */
class Orders
{
    public static $type_array = array(
        1 => '支付宝',
        2 => '微信',
        3 => '银联',
//        4 => '余额'
    );

    public static $status_array = array(
        1 => '待支付',
        2 => '待发货',
        3 => '待收货',
//        4 => '待评价',
        5 => '已完成',
        6 => '退款中',
        7 => '退款成功',
        8 => '退款失败',
        9 => '退货中',
        10 => '退货成功',
        11 => '退货失败'
    );


    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="BaseBundle\Entity\User", inversedBy="id")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    private $user;

    /**
     * @var integer
     *
     * @ORM\Column(name="type", type="smallint", options={"comment":"支付方式"})
     */
    private $type;

    /**
     * @var boolean
     *
     * @ORM\Column(name="status", type="boolean", options={"comment":"订单状态"})
     */
    private $status;

    /**
     * @var string
     *
     * @ORM\Column(name="total", type="decimal", precision=10, scale=2,  nullable=true, options={"comment"="总价=总邮费+总商品价格"})
     */
    private $money;

    /**
     * @var string
     *
     * @ORM\Column(name="goods_total", type="decimal", precision=10, scale=2,  nullable=true, options={"comment"="商品总价"})
     */
    private $goods_total;

    /**
     * @var string
     *
     * @ORM\Column(name="postage_total", type="decimal", precision=10, scale=2, nullable=true,options={"comment"="邮费总价", "default"="0.00"})
     */
    private $postage_total;

    /**
     * @var string
     *
     * @ORM\Column(name="order_no", type="string", length=45,  options={"comment":"订单号"})
     */
    private $order_no;

    /**
     * @var string
     *
     * @ORM\Column(name="trade_no", type="string", length=120, nullable=true, options={"comment":"第三方交易号"})
     */
    private $trade_no;

    /**
     * @var Area
     *
     * @ORM\ManyToOne(targetEntity="BaseBundle\Entity\Area", inversedBy="id")
     * @ORM\JoinColumn(name="province_id", referencedColumnName="id")
     */
    private $province;

    /**
     * @var Area
     *
     * @ORM\ManyToOne(targetEntity="BaseBundle\Entity\Area", inversedBy="id")
     * @ORM\JoinColumn(name="city_id", referencedColumnName="id")
     */
    private $city;

    /**
     * @var Area
     *
     * @ORM\ManyToOne(targetEntity="BaseBundle\Entity\Area", inversedBy="id")
     * @ORM\JoinColumn(name="district_id", referencedColumnName="id")
     */
    private $district;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=45, nullable=true, options={"comment":"收货人"})
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="contact_way", type="string", nullable=true, length=13, options={"comment":"联系方式"})
     */
    private $contact_way;

    /**
     * @var string
     *
     * @ORM\Column(name="address", type="string", nullable=true, length=255, options={"comment":"具体地址(不包含省市区地址)"})
     */
    private $address;

    /**
     * @var string
     *
     * @ORM\Column(name="post_code", type="string", nullable=true, length=10, options={"comment":"邮政编码"})
     */
    private $post_code;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime", options={"comment":"创建时间"})
     */
    private $createdAt;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"更新时间"})
     */
    private $updatedAt;


    /**
     * @var string
     *
     * @ORM\Column(name="remarks", type="string", length=225, nullable=true, options={"comment":"备注信息"})
     */
    private $remarks;

    /**
     * @var string
     *
     * @ORM\Column(name="purchase_total_price", type="decimal", precision=10, scale=2, options={"comment"="进货总价", "default"="0.00"})
     */
    private $purchase_total_price;


    /**
     * @var string
     *
     * @ORM\Column(name="total_profit", type="decimal", precision=10, scale=2, nullable=true, options={"comment"="总利润(总价-进货总价)", "default"="0.00"})
     */
    private $total_profit;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_delete", type="boolean", options={"comment":"订单是否删除", "default"="0"})
     */
    private $is_delete;

    /**
     * @var string
     *
     * @ORM\Column(name="total_distribution", type="decimal", precision=10, scale=2, options={"comment"="分销奖励总价", "default"="0.00"})
     */
    private $total_distribution;

}
